package com.bytz.modules.cms.order.controller;

import com.bytz.common.api.vo.Result;
import com.bytz.modules.cms.order.entity.OrderPickUpDetail;
import com.bytz.modules.cms.order.service.IOrderPickUpDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "提货")
@RequestMapping("/pickUp")
public class OrderPickUpController {

    @Autowired
    private IOrderPickUpDetailService pickUpService;

    @ApiOperation("根据订单id获取提货情况")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public Result<List<OrderPickUpDetail>> getDetail(@RequestParam String orderId) {
        return Result.ok(pickUpService.getByOrderId(orderId));
    }

    @ApiOperation("根据支付id获取提货情况")
    @RequestMapping(value = "/listByPay", method = RequestMethod.GET)
    public Result<List<OrderPickUpDetail>> listByPay(@RequestParam String payId) {
        return Result.ok(pickUpService.getByOrderPayId(payId));
    }

}
